{	Problem: http://codeforces.ru/problemset/problem/74/B
	Verdict: Accepted
}
var i,n,m,k,ls,r:longint; s:string; f:boolean;
begin
readln(n,m,k);
readln(s);
delete(s,1,pos(' ',s));
f:=false;
if s='tail' then f:=true;
readln(s);
ls:=length(s);
r:=-1;
if k=m then r:=0 else begin
for i:=1 to ls do begin
  if f then begin
    if k=n then begin
      dec(k);
      f:=false;
    end else inc(k);
  end else begin
    if k=1 then begin
      inc(k);
      f:=true;
    end else dec(k);
  end;
  if f then begin
    if s[i]='1' then begin
      m:=1;
    end else begin
      if m-k>=0 then begin
        if (m-k>1) and (m>1) then dec(m) else
        if abs(m-k)<1 then inc(m);
      end else begin
        if (k-m>0) and (m<n) then inc(m) else
        if abs(m-k)<1 then dec(m);
      end;
    end;
  end else begin
    if s[i]='1' then begin
      m:=n;
    end else begin
      if k-m>=0 then begin
        if (k-m>1) and (m<n) then inc(m) else 
        if abs(m-k)<1 then dec(m);
      end else begin
        if (m-k>0) and (m>1) then dec(m) else 
        if abs(m-k)<1 then inc(m);
      end;  
    end;
  end;
  if ((k=m) or (m<1) or (m>n)) and (i<>ls) then begin
    r:=i;
    break;
  end;
end;
end;
if r=-1 then write('Stowaway') else write('Controller ',r);
end.